function start_category(){ "use strict"; var category, city, area, ajaxurl; city=jQuery('#advanced_city').attr('data-value'); area=jQuery('#advanced_area').attr('data-value'); ajaxurl=ajaxcalls_vars.admin_url + 'admin-ajax.php'; jQuery("[aria-labelledby='adv_categ']").empty(); } function start_filtering_ajax_map(newpage){ "use strict"; var action, category, city, area, country, rooms, baths, beds, min_price, price_max, ajaxurl, postid, guest_no, check_out, check_in, all_checkers; action=jQuery('#adv_actions').attr('data-value'); category=jQuery('#adv_categ').attr('data-value'); city=jQuery('#advanced_city').attr('data-value'); area=jQuery('#advanced_area').attr('data-value'); country=jQuery('#search_location_country').val(); rooms=parseInt(jQuery('#rooms_no_input').val(), 10); baths=parseInt(jQuery('#baths_no_input').val(), 10); beds=parseInt(jQuery('#beds_no_input').val(), 10); if(isNaN(rooms)){ rooms=''; } if(isNaN(baths)){ baths=''; } if(isNaN(beds)){ beds=''; } min_price=parseInt(jQuery('#price_low').val(), 10); price_max=parseInt(jQuery('#price_max').val(), 10); guest_no=parseInt(jQuery('#guest_no_input').val(), 10); if(isNaN(guest_no)){ guest_no=''; } check_in=jQuery('#check_in_list').val(); check_out=jQuery('#check_out_list').val(); all_checkers=''; jQuery('#extended_search_check_filter input[type="checkbox"]').each(function (){ if(jQuery(this).is(":checked")){ all_checkers=all_checkers + "," + jQuery(this).attr("id"); }}); postid=parseInt(jQuery('#adv-search-1').attr('data-postid'), 10); if(isNaN(postid)){ postid=parseInt(jQuery('#adv_extended_options_text_adv').attr('data-pageid'), 10); } ajaxurl=ajaxcalls_vars.admin_url + 'admin-ajax.php'; jQuery('#listing_ajax_container').empty(); jQuery('#listing_loader').show(); jQuery.ajax({ type: 'POST', url: ajaxurl, dataType: 'json', data: { 'action': 'wpestate_ajax_filter_listings_search_onthemap', 'action_values': action, 'category_values': category, 'city': city, 'area': area, 'advanced_rooms': rooms, 'advanced_bath': baths, 'advanced_beds': beds, 'guest_no': guest_no, 'price_low': min_price, 'price_max': price_max, 'newpage': newpage, 'postid': postid, 'check_in': check_in, 'check_out': check_out, 'all_checkers': all_checkers, 'country': country }, success: function (data){ jQuery('#advanced_search_map_list').removeClass('move_to_fixed'); jQuery('#listing_loader').hide(); jQuery('.listing_loader_title').show(); jQuery('#listing_ajax_container').empty().append(data.response); jQuery('.pagination_nojax').remove(); restart_js_after_ajax(); var new_markers=jQuery.parseJSON(data.markers); if(new_markers.length > 0){ if(infoBox!==null){ infoBox.close(); } wpestate_set_filter_pins(map, new_markers); }}, error: function (errorThrown){ }}); } function start_filtering_ajax_on_main_map(guest_no){ "use strict"; var action, category, country, city, area, rooms, baths, beds, min_price, price_max, ajaxurl, postid, guest_no, check_out, check_in, all_checkers; city=jQuery('#advanced_city').val(); area=jQuery('#advanced_area').val(); country=jQuery('#advanced_country').val(); if(isNaN(guest_no)){ guest_no=''; } check_in=jQuery('#check_in').val(); check_out=jQuery('#check_out').val(); postid=parseInt(jQuery('#adv-search-1').attr('data-postid'), 10); if(isNaN(postid)){ postid=parseInt(jQuery('#adv_extended_options_text_adv').attr('data-pageid'), 10); } ajaxurl=ajaxcalls_vars.admin_url + 'admin-ajax.php'; jQuery.ajax({ type: 'POST', url: ajaxurl, dataType: 'json', data: { 'action': 'wpestate_ajax_filter_listings_search_on_main_map', 'action_values': action, 'category_values': category, 'city': city, 'area': area, 'advanced_rooms': rooms, 'advanced_bath': baths, 'advanced_beds': beds, 'guest_no': guest_no, 'price_low': min_price, 'price_max': price_max, 'postid': postid, 'check_in': check_in, 'check_out': check_out, 'all_checkers': all_checkers, 'country': country }, success: function (data){ var new_markers=jQuery.parseJSON(data.markers); if(new_markers.length > 0){ wpestate_set_filter_pins(map, new_markers); jQuery('#gmap-noresult').hide(); jQuery("#results, #showinpage,#showinpage_mobile").show(); jQuery("#results_no").show().empty().append(data.counter); }else{ jQuery('#gmap-noresult').show(); jQuery('#results').hide(); }}, error: function (errorThrown){ }}); } function get_filtering_ajax_result(){ "use strict"; var action, category, city, area, rooms, baths, min_price, price_max, ajaxurl, postid; action=jQuery('#adv_actions').attr('data-value'); category=jQuery('#adv_categ').attr('data-value'); city=jQuery('#advanced_city').attr('data-value'); area=jQuery('#advanced_area').attr('data-value'); rooms=parseInt(jQuery('#adv_rooms').val(), 10); baths=parseInt(jQuery('#adv_bath').val(), 10); min_price=parseInt(jQuery('#price_low').val(), 10); price_max=parseInt(jQuery('#price_max').val(), 10); postid=parseInt(jQuery('#adv-search-1').attr('data-postid'), 10); ajaxurl=ajaxcalls_vars.admin_url + 'admin-ajax.php'; jQuery.ajax({ type: 'POST', url: ajaxurl, data: { 'action': 'wpestate_get_filtering_ajax_result', 'action_values': action, 'category_values': category, 'city': city, 'area': area, 'advanced_rooms': rooms, 'advanced_bath': baths, 'price_low': min_price, 'price_max': price_max, 'postid': postid }, success: function (data){ jQuery("#results, #showinpage,#showinpage_mobile").show(); jQuery("#results_no").show().empty().append(data); }, error: function (errorThrown){ }}); } function custom_get_filtering_ajax_result(){ "use strict"; var val1, val2, val3, val4, val5, val6, val7, val8, ajaxurl, postid; val1=get_custom_value(mapfunctions_vars.slugs[0]); val2=get_custom_value(mapfunctions_vars.slugs[1]); val3=get_custom_value(mapfunctions_vars.slugs[2]); val4=get_custom_value(mapfunctions_vars.slugs[3]); val5=get_custom_value(mapfunctions_vars.slugs[4]); val6=get_custom_value(mapfunctions_vars.slugs[5]); val7=get_custom_value(mapfunctions_vars.slugs[6]); val8=get_custom_value(mapfunctions_vars.slugs[7]); postid=parseInt(jQuery('#adv-search-1').attr('data-postid'), 10); ajaxurl=ajaxcalls_vars.admin_url + 'admin-ajax.php'; jQuery.ajax({ type: 'POST', url: ajaxurl, data: { 'action': 'custom_adv_get_filtering_ajax_result', 'val1': val1, 'val2': val2, 'val3': val3, 'val4': val4, 'val5': val5, 'val6': val6, 'val7': val7, 'val8': val8, 'postid': postid }, success: function (data){ jQuery("#results, #showinpage,#showinpage_mobile").show(); jQuery("#results_no").show().empty().append(data); }, error: function (errorThrown){ }}); } function start_filtering_ajax(newpage){ "use strict"; var action, guest_no, country, check_out, check_in, category, city, area, rooms, baths, min_price, price_max, ajaxurl, postid; action=jQuery('#adv_actions').attr('data-value'); category=jQuery('#adv_categ').attr('data-value'); city=jQuery('#advanced_city').attr('data-value'); area=jQuery('#advanced_area').attr('data-value'); country=jQuery('#advanced_country').attr('data-value'); rooms=parseInt(jQuery('#adv_rooms').val(), 10); baths=parseInt(jQuery('#adv_bath').val(), 10); min_price=parseInt(jQuery('#price_low').val(), 10); price_max=parseInt(jQuery('#price_max').val(), 10); postid=parseInt(jQuery('#adv-search-1').attr('data-postid'), 10); check_in=jQuery('#check_in').val(); check_out=jQuery('#check_out').val(); guest_no=jQuery('#guest_no_main').val(); ajaxurl=ajaxcalls_vars.admin_url + 'admin-ajax.php'; jQuery('#listing_ajax_container').empty(); jQuery('.listing_loader_title').show(); jQuery('#internal-loader').show(); jQuery.ajax({ type: 'POST', url: ajaxurl, data: { 'action': 'wpestate_ajax_filter_listings_search', 'action_values': action, 'category_values': category, 'city': city, 'area': area, 'advanced_rooms': rooms, 'advanced_bath': baths, 'price_low': min_price, 'price_max': price_max, 'newpage': newpage, 'postid': postid, 'check_in': check_in, 'check_out': check_out, 'guest_no': guest_no, 'country': country }, success: function (data){ jQuery('#internal-loader,#listing_loader').hide(); jQuery('#listing_ajax_container').addClass('load_from_ajax').empty().append(data); restart_js_after_ajax(); }, error: function (errorThrown){ }}); } function custom_search_start_filtering_ajax(newpage){ "use strict"; var val1, val2, val3, val4, val5, val6, val7, val8, ajaxurl, postid, slider_min, slider_max; val1=get_custom_value(mapfunctions_vars.slugs[0]); val2=get_custom_value(mapfunctions_vars.slugs[1]); val3=get_custom_value(mapfunctions_vars.slugs[2]); val4=get_custom_value(mapfunctions_vars.slugs[3]); val5=get_custom_value(mapfunctions_vars.slugs[4]); val6=get_custom_value(mapfunctions_vars.slugs[5]); val7=get_custom_value(mapfunctions_vars.slugs[6]); val8=get_custom_value(mapfunctions_vars.slugs[7]); slider_min=parseInt(jQuery('#price_low').val(), 10); slider_max=parseInt(jQuery('#price_max').val(), 10); postid=parseInt(jQuery('#adv-search-1').attr('data-postid'), 10); ajaxurl=ajaxcalls_vars.admin_url + 'admin-ajax.php'; jQuery('#listing_ajax_container').empty(); jQuery('#internal-loader').show(); jQuery.ajax({ type: 'POST', url: ajaxurl, data: { 'action': 'wpestate_custom_adv_ajax_filter_listings_search', 'val1': val1, 'val2': val2, 'val3': val3, 'val4': val4, 'val5': val5, 'val6': val6, 'val7': val7, 'val8': val8, 'newpage': newpage, 'postid': postid, 'slider_min': slider_min, 'slider_max': slider_max }, success: function (data){ jQuery('#internal-loader').hide(); jQuery('.listing_loader_title').show(); jQuery('#listing_ajax_container').empty().append(data); restart_js_after_ajax(); }, error: function (errorThrown){ }}); } function restart_js_after_ajax(){ "use strict"; var newpage, post_id, post_image, to_add, icon, already_in, i, bLazy; jQuery('.listing_wrapper').hover(function (){ var listing_id=jQuery(this).attr('data-listid'); }, function (){ var listing_id=jQuery(this).attr('data-listid'); }); jQuery('.prop-compare:first-of-type').remove(); jQuery('.pagination_ajax_search a').click(function (event){ event.preventDefault(); newpage=parseInt(jQuery(this).attr('data-future'), 10); document.getElementById('scrollhere').scrollIntoView(); start_filtering_ajax(newpage); }); jQuery('.pagination_ajax a').click(function (event){ event.preventDefault(); newpage=parseInt(jQuery(this).attr('data-future'), 10); document.getElementById('scrollhere').scrollIntoView(); start_filtering(newpage); }); jQuery('.pagination_ajax_search_home a').click(function (event){ event.preventDefault(); newpage=parseInt(jQuery(this).attr('data-future'), 10); document.getElementById('scrollhere').scrollIntoView(); start_filtering_ajax_map(newpage); }); already_in=[]; jQuery('.compare-action').click(function (e){ e.preventDefault(); e.stopPropagation(); jQuery('.prop-compare').show(); post_id=jQuery(this).attr('data-pid'); for (i=0; i < already_in.length; i++){ if(already_in[i]===post_id){ return; }} already_in.push(post_id); post_image=jQuery(this).attr('data-pimage'); to_add=''; jQuery('div.items_compare:first-child').css('background', 'red'); if(parseInt(jQuery('.items_compare').length, 10) > 3){ jQuery('.items_compare:first').remove(); } jQuery('#submit_compare').before(to_add); jQuery('.items_compare').fadeIn(800); }); jQuery('#submit_compare').click(function (){ jQuery('#form_compare').trigger('submit'); }); jQuery('.icon-fav').click(function (event){ event.stopPropagation(); icon=jQuery(this); add_remove_favorite(icon); }); jQuery(".share_list, .icon-fav, .compare-action").hover(function (){ jQuery(this).tooltip('show'); }, function (){ jQuery(this).tooltip('hide'); }); jQuery('.share_list').click(function (){ var sharediv=jQuery(this).parent().find('.share_unit'); sharediv.toggle(); jQuery(this).toggleClass('share_on'); }); } function add_remove_favorite(icon){ "use strict"; var post_id, securitypass, ajaxurl; post_id=icon.attr('data-postid'); securitypass=jQuery('#security-pass').val(); ajaxurl=ajaxcalls_vars.admin_url + 'admin-ajax.php'; if(parseInt(ajaxcalls_vars.userid, 10)===0){ show_login_form(1, 1, 0); }else{ icon.toggleClass('icon-fav-off'); icon.toggleClass('icon-fav-on'); jQuery.ajax({ type: 'POST', url: ajaxurl, dataType: 'json', data: {'action': 'wpestate_ajax_add_fav', 'post_id': post_id}, success: function (data){ if(data.added){ icon.removeClass('icon-fav-off').addClass('icon-fav-on'); icon.attr('data-original-title', ajaxcalls_vars.remove_favorite); }else{ icon.removeClass('icon-fav-on').addClass('icon-fav-off'); icon.attr('data-original-title', ajaxcalls_vars.add_favorite_unit); }}, error: function (errorThrown){ }}); }} function resend_for_approval(prop_id, selected_div){ "use strict"; var ajaxurl, normal_list_no; ajaxurl=control_vars.admin_url + 'admin-ajax.php'; jQuery.ajax({ type: 'POST', url: ajaxurl, data: {'action': 'wpestate_ajax_resend_for_approval', 'propid': prop_id}, success: function (data){ if(data==='pending'){ selected_div.parent().empty().append('Sent for approval'); normal_list_no=parseInt(jQuery('#normal_list_no').text(), 10); jQuery('#normal_list_no').text(normal_list_no - 1); }else{ selected_div.parent().empty().append(data); }}, error: function (errorThrown){ }}); } function make_prop_featured(prop_id, selectedspan){ "use strict"; var ajaxurl=ajaxcalls_vars.admin_url + 'admin-ajax.php'; jQuery.ajax({ type: 'POST', url: ajaxurl, data: {'action': 'wpestate_ajax_make_prop_featured', 'propid': prop_id}, success: function (data){ if(data.trim()==='done'){ selectedspan.empty().html('' + ajaxcalls_vars.prop_featured + ''); selectedspan.removeClass('dashboad-tooltip'); var featured_list_no=parseInt(jQuery('#featured_list_no').text(), 10); jQuery('#featured_list_no').text(featured_list_no - 1); }else{ selectedspan.empty().removeClass('make_featured').addClass('featured_exp').removeClass('dashboad-tooltip').text(ajaxcalls_vars.no_prop_featured); }}, error: function (errorThrown){ }}); } function recuring_pay_pack_via_paypal(){ "use strict"; var ajaxurl, packName, packId; ajaxurl=control_vars.admin_url + 'admin-ajax.php'; packName=jQuery('#pack_select :selected').text(); packId=jQuery('#pack_select :selected').val(); jQuery.ajax({ type: 'POST', url: ajaxurl, data: {'action': 'wpestate_ajax_paypal_pack_recuring_generation', 'packName': packName, 'packId': packId}, success: function (data){ window.location.href=data; }, error: function (errorThrown){ }}); } function pay_pack_via_paypal(){ "use strict"; var ajaxurl, packName, packId; ajaxurl=control_vars.admin_url + 'admin-ajax.php'; packName=jQuery('#pack_select :selected').text(); packId=jQuery('#pack_select :selected').val(); jQuery.ajax({ type: 'POST', url: ajaxurl, data: {'action': 'wpestate_ajax_paypal_pack_generation', 'packName': packName, 'packId': packId}, success: function (data){ window.location.href=data; }, error: function (errorThrown){ }}); } function listing_pay(prop_id, selected_div, is_featured, is_upgrade){ "use strict"; var ajaxurl=control_vars.admin_url + 'admin-ajax.php'; jQuery.ajax({ type: 'POST', url: ajaxurl, data: { 'action': 'wpestate_ajax_listing_pay', 'propid': prop_id, 'is_featured': is_featured, 'is_upgrade': is_upgrade }, success: function (data){ window.location.href=data; }, error: function (errorThrown){ }}); } function start_filtering(newpage){ "use strict"; jQuery('#grid_view').addClass('icon_selected'); jQuery('#list_view').removeClass('icon_selected'); var action, category, city, area, order, ajaxurl, page_id; action=jQuery('#a_filter_action').attr('data-value'); category=jQuery('#a_filter_categ').attr('data-value'); city=jQuery('#a_filter_cities').attr('data-value'); area=jQuery('#a_filter_areas').attr('data-value'); order=jQuery('#a_filter_order').attr('data-value'); ajaxurl=ajaxcalls_vars.admin_url + 'admin-ajax.php'; page_id=jQuery('#page_idx').val(); jQuery('#listing_ajax_container').empty(); jQuery('#listing_loader').show(); jQuery.ajax({ type: 'POST', url: ajaxurl, data: { 'action': 'wpestate_ajax_filter_listings', 'action_values': action, 'category_values': category, 'city': city, 'area': area, 'order': order, 'newpage': newpage, 'page_id': page_id }, success: function (data){ jQuery('#listing_loader').hide(); jQuery('#listing_ajax_container').empty().append(data); jQuery('.pagination_nojax').hide(); restart_js_after_ajax(); }, error: function (errorThrown){ }}); } function show_login_form(type, ispop, propid){ "use strict"; var ajaxurl=ajaxcalls_vars.admin_url + 'admin-ajax.php'; jQuery.ajax({ type: 'POST', url: ajaxurl, data: {'action': 'wpestate_ajax_show_login_form', 'type': type, 'ispop': ispop, 'propid': propid}, success: function (data){ jQuery('body').append(data); jQuery('#loginmodal').modal(); enable_actions_modal(); }, error: function (errorThrown){ }}); } function show_login_form_booking(type, ispop, propid){ "use strict"; var ajaxurl=ajaxcalls_vars.admin_url + 'admin-ajax.php'; jQuery.ajax({ type: 'POST', url: ajaxurl, data: {'action': 'wpestate_ajax_show_login_form_booking', 'type': type, 'ispop': ispop, 'propid': propid}, success: function (data){ jQuery('body').append(data); jQuery('#loginmodal').modal(); enable_actions_modal(); }, error: function (errorThrown){ }}); } function wpestate_change_pass_profile(){ "use strict"; var oldpass, newpass, renewpass, securitypass, ajaxurl; oldpass=jQuery('#oldpass').val(); newpass=jQuery('#newpass').val(); renewpass=jQuery('#renewpass').val(); securitypass=jQuery('#security-pass').val(); ajaxurl=ajaxcalls_vars.admin_url + 'admin-ajax.php'; jQuery.ajax({ type: 'POST', url: ajaxurl, data: { 'action': 'wpestate_ajax_update_pass', 'oldpass': oldpass, 'newpass': newpass, 'renewpass': renewpass, 'security-pass': securitypass }, success: function (data){ jQuery('#profile_pass').empty().append('
' + data + '
'); jQuery('#oldpass, #newpass, #renewpass').val(''); }, error: function (errorThrown){ }}); } function wpestate_register(ajaxUrl, userLoginId, userEmailId, nonceId, messageAreaId){ "use strict"; var user_login_register=jQuery(userLoginId).val(); var user_email_register=jQuery(userEmailId).val(); var nonce=jQuery(nonceId).val(); var ajaxurl=ajaxUrl + 'admin-ajax.php'; jQuery.ajax({ type: 'POST', url: ajaxurl, dataType: 'json', data: { 'action': 'wpestate_ajax_register_form', 'user_login_register': user_login_register, 'user_email_register': user_email_register, 'security-register': nonce }, success: function(data){ var messageType=data.register ? '':'alert_err '; jQuery(messageAreaId).empty().append('
' + data.message + '
'); jQuery(userLoginId).val(''); jQuery(userEmailId).val(''); }, error: function(errorThrown){ }}); } function wpestate_register_wd(){ "use strict"; var user_login_register, user_email_register, nonce, ajaxurl; user_login_register=jQuery('#user_login_register_wd').val(); user_email_register=jQuery('#user_email_register_wd').val(); nonce=jQuery('#security-register').val(); ajaxurl=ajaxcalls_vars.admin_url + 'admin-ajax.php'; jQuery.ajax({ type: 'POST', url: ajaxurl, dataType: 'json', data: { 'action': 'wpestate_ajax_register_form', 'user_login_register': user_login_register, 'user_email_register': user_email_register, 'security-register': nonce }, success: function (data){ if(data.register===true){ jQuery('#register_message_area_wd').empty().append(''); }else{ jQuery('#register_message_area_wd').empty().append(''); } jQuery('#user_login_register_wd').val(''); jQuery('#user_email_register_wd').val(''); }, error: function (errorThrown){ }}); } function wpestate_register_wd_mobile(){ "use strict"; var user_login_register, user_email_register, nonce, ajaxurl; user_login_register=jQuery('#user_login_register_wd_mobile').val(); user_email_register=jQuery('#user_email_register_wd_mobile').val(); nonce=jQuery('#security-register-mobile').val(); ajaxurl=ajaxcalls_vars.admin_url + 'admin-ajax.php'; jQuery.ajax({ type: 'POST', url: ajaxurl, dataType: 'json', data: { 'action': 'wpestate_ajax_register_form', 'user_login_register': user_login_register, 'user_email_register': user_email_register, 'security-register': nonce }, success: function (data){ if(data.register===true){ jQuery('#register_message_area_wd_mobile').empty().append(''); }else{ jQuery('#register_message_area_wd_mobile').empty().append(''); } jQuery('#user_login_register_wd_mobile').val(''); jQuery('#user_email_register_wd_mobile').val(''); }, error: function (errorThrown){ }}); } function wpestate_forgot(type){ "use strict"; var forgot_email, securityforgot, postid, ajaxurl; postid=jQuery('#postid').val(); ajaxurl=ajaxcalls_vars.admin_url + 'admin-ajax.php'; if(type===1){ forgot_email=jQuery('#forgot_email_mod').val(); securityforgot=jQuery('#security-login-forgot_wd').val(); } if(type===2){ forgot_email=jQuery('#forgot_email').val(); securityforgot=jQuery('#security-forgot').val(); } if(type===3){ forgot_email=jQuery('#forgot_email_shortcode').val(); securityforgot=jQuery('#security-login-forgot_wd').val(); } if(type===4){ forgot_email=jQuery('#forgot_email_mobile').val(); securityforgot=jQuery('#security-login-forgot_wd_mobile').val(); } jQuery.ajax({ type: 'POST', url: ajaxurl, data: { 'action': 'wpestate_ajax_forgot_pass', 'forgot_email': forgot_email, 'security-forgot': securityforgot, 'postid': postid, 'type': type }, success: function (data){ if(type===1){ jQuery('#forgot_email_mod').val(''); jQuery('#forgot_pass_area_shortcode').empty().append('